package file;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class ScannerDemo {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("D:/temp/hello.txt")){
            try(Scanner scanner = new Scanner(inputStream)){
                while (scanner.hasNext()){
                    System.out.println(scanner.nextLine());
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
